package com.nageoffer.jobtrain.admin.toolkit;

import java.util.Arrays;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * 字符串分割工具类
 * author：唐晨
 */
public class SplitStrUtils {
    /**
     * 根据特殊字符进行分割OJ题目ID集合
     */
    private final static String splitStr = ",";

    public static Set<Long> splitOjIdList(String idStr) {
        String[] idStrList = idStr.split(splitStr);
        return Arrays.stream(idStrList)
                .map(Long::valueOf)
                .collect(Collectors.toSet());
    }
}
